from MeiTuan.cal_utility import *

class Governance:
    Type = 2
    def __init__(self,
                 intervention_strategy = 1,
                 energy = 100,
                 tax_rate = 0.1,
                 preiod = 100):
        self.intervention_strategy = intervention_strategy
        self.energy = energy
        self.tax_rate = tax_rate
        self.period = preiod
    
    def cal_fairness(self, riders):
        """
        计算系统内骑手的时间收益公平性

        Args: riders
        
        """
        coins = []
        labor = []
        revenue = 0
        for r in riders:
            coins.append(r.step_income)
            labor.append(r.step_cost)
            revenue += r.money

        fairness = temporal_earnings_fairness(coins, labor)
        print("公平性： ", fairness, "系统总收入：", revenue )
        return fairness




    

